﻿#region Using
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
#endregion // Using

namespace Mvp.Library.Entities
{
    [Table("dbo.Configuration")]
    public class Configuration
    {
        #region Constructor
        /**********************************************************************
         * Constructor
         *********************************************************************/
        public Configuration ()
	    {
	    }// of constructor()
        #endregion // Constructor

        #region Properties
        /**********************************************************************
         * Properties
         *********************************************************************/
        #region Data Properties
        [Column("ConfigurationId")]
        [Key]
        public int Id { get; internal set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public bool IsActive { get; set; }

        public virtual ICollection<ConfigurationSetting> Settings { get; set; }
        #endregion // Data Properties
        #endregion // Properties

        #region Methods
        /**********************************************************************
         * Methods
         *********************************************************************/
        public void AddSetting(ConfigurationSetting setting)
        {
            if (this.Settings == null) { this.Settings = new List<ConfigurationSetting>(); }

            this.Settings.Add(setting);
        }// of AddSetting(ConfigurationSetting)
        #endregion // Methods
    }// of class Configuration
}// of namespace Mvp.Library.Entities